package com.rec.entity;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

@Entity
@Table(name="statistics")
@NoArgsConstructor
@AllArgsConstructor
public class Statistics {
		@Id
		@GeneratedValue(strategy=GenerationType.IDENTITY)
		private Integer id;
		private Integer readroomid;
		private Integer peoplenums;
		private String time;
		@ManyToOne(targetEntity=Readrooms.class,fetch=FetchType.EAGER)
		@JoinColumn(name="readroomid",insertable=false,updatable=false)
		private Readrooms r;
		public Integer getId() {
			return id;
		}
		public void setId(Integer id) {
			this.id = id;
		}
		public Integer getReadroomid() {
			return readroomid;
		}
		public void setReadroomid(Integer readroomid) {
			this.readroomid = readroomid;
		}
		public Integer getPeoplenums() {
			return peoplenums;
		}
		public void setPeoplenums(Integer peoplenums) {
			this.peoplenums = peoplenums;
		}
		public String getTime() {
			return time;
		}
		public void setTime(String time) {
			this.time = time;
		}
		public Readrooms getR() {
			return r;
		}
		public void setR(Readrooms r) {
			this.r = r;
		}
		
}
